/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.google.code.peersim.pastry.protocol;

/**
 * A response message used to answer to routing-table entry replacement requests.
 * The key stores the dead node id.
 *
 * @author frusso
 * @version 0.1
 * @since 0.1
 */
class RoutingTableEntryRsp extends RoutingTableEntryReq {

  private PastryNodeDescriptor entry;

  /**
   * Constructor.
   *
   * @param deadNodeId The dead node id
   * @param src The sender
   * @param dst The destination
   * @param entry The replacement
   * @param l Pastry {@code L} parameter
   * @param d Pastry {@code d} parameter
   */
  RoutingTableEntryRsp(PastryId deadNodeId, PastryNode src, PastryNode dst, PastryNodeDescriptor entry,  int l, char d) {
    super(deadNodeId, src, dst, l, d);
    super.setType(Type.ROUTING_TABLE_ENTRY_RSP);
    this.entry = entry;
  }

  /**
   * Returns the replacement entry.
   *
   * @return The replacement entry
   */
  public PastryNodeDescriptor getEntry() {
    return entry;
  }
}